package com.hyx.bookManager.mapper;

import com.hyx.bookManager.domain.po.Permission;
import com.hyx.bookManager.domain.po.Role;
import com.hyx.bookManager.domain.po.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import javax.annotation.security.PermitAll;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName UserDao
 * @Description TODO
 * @Author 黄乙轩
 * @Date 2021/6/12 23:03
 * @Version 1.0
 **/

@Mapper
@Component
public interface UserMapper {
    ArrayList<User> getAllUser();

    int getUserByEmail(String email);

    void insertUser(@Param("name") String name, @Param("password") String password, @Param("email") String email,@Param("id") Long id, @Param("createTime")LocalDateTime createTime,@Param("updateTime")LocalDateTime updateTime);

    int getUserByAmmount(@Param("id") String ammount,@Param("password") String password);

    Role getUserRoleByAmmount(Long id);

    List<Permission> getPermissionByRoleId(Long roleId);

    void insertUserRole(@Param("id") Long id, @Param("roleId") Integer roleId, @Param("cid")Long cid);

    List<Long> getCurrentUser(@Param("before") LocalDate before,@Param("now") LocalDate now);
}
